package blackhouse.laobi.net.day24;

import java.net.*;
import java.io.*;
public class MyIE {
 
	public static void main(String[] args) throws Exception {
		 Socket s = new Socket("127.0.0.1",8080);
		 
		 PrintWriter out  =new PrintWriter(s.getOutputStream(),true);
		 
		 out.println("GET / HTTP/1.1");
		 out.println("Accept: text/html, application/xhtml+xml, ");
		 out.println("Accept-Language: zh-CN");
		 out.println("Host: 127.0.0.1:8080");
		 out.println("Connection: closed");
		 out.println("");
		 out.println("");

		 BufferedReader bufr = new BufferedReader(new InputStreamReader(s.getInputStream()));
		 
		 String line = null;
		 
		 while((line= bufr.readLine())!=null){
			 System.out.println(line);
		 }
		 s.close();
	}

}
